<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="cw" uri="/widget-tags"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<cw:base />
		<script type="text/javascript">
			
		</script>
	</head>
	<bod>
		<ul>
			<li>
				<cw:fieldSet title="树表格" content="treeGridDiv" collapsible="true" collapsed="false"/>
				<div id="treeGridDiv">
					<cw:treeGrid id="treeGrid" url="${pageContext.request.contextPath }/sample/grid/treegrid.action" 
						forceFit="true" treeColumn="organization" height="360">
							<cw:gridColumn property="id" title="编号" dataType="int" width="10%" align="center"/>
							<cw:gridColumn property="organization" title="组织" width="20%" align="center"/>
							<cw:gridColumn property="orgLevel" title="级别" width="10%" align="center"/>
							<cw:gridColumn property="createTime" title="创建时间" width="20%" align="center"/>
					</cw:treeGrid>
				</div>
			</li>
		</ul>
		<cw:theme></cw:theme>
		<script type="text/javascript">
			Ext.onReady(function(){
				var STORE = Ext.getCmp('treeGrid').store;
				STORE.on("load",function(s,r,o){
					resetHeight("treeGridFrame");
			    });
				
				resetHeight("treeGridFrame");
			})
		
			function resetHeight(frame) {
				var ifm = parent.document.getElementById(frame);
				var obj = document.body;
				var oStyle = obj.currentStyle? obj.currentStyle : window.getComputedStyle(obj, false);
				var initHeight = parseInt(document.body.clientHeight+parseInt(oStyle["margin-top"])+parseInt(oStyle["margin-bottom"]));
				ifm.height = parseInt(initHeight);
			}
		</script>
	</body>
</html>